package neu.soft.util;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 李博
 * 模拟发票生成工厂，负责生成发票代码、发票号码和发票名字
 */
public class InvoiceMockFactory {

    public static Map<String,String> builder(String cityName,String cityId, String batch, String year, String ticketType){
        Map<String,String> codes = new HashMap<>();
        String invoiceCode = "0" + cityId +
                year +
                batch +
                ticketType;
        codes.put("invoiceCode",invoiceCode);
        String num = String.valueOf((int) ((Math.random() * 9 + 1) * 100000*100));
        String invoiceNum = "No"+num;
        codes.put("invoiceNum",invoiceNum);
        String invoiceName = cityName+"增值税电子普通发票";
        codes.put("invoiceName",invoiceName);
        return codes;
    }
}
